Skip to content

Theme System: Public serving of files#5405

Merged
ssddanbrown merged 3 commits intodevelopmentfrom
public_theme_files
Jan 14, 2025
Merged

Theme System: Public serving of files#5405
ssddanbrown merged 3 commits intodevelopmentfrom
public_theme_files

Conversation

@ssddanbrown
Copy link
Copy Markdown
Member

@ssddanbrown ssddanbrown commented Jan 13, 2025

Allows files to be placed within a public/ folder within a theme directory which the contents of will served by BookStack for access. For #3904

A file placed at <theme_folder>/public/cat.jpg could be accessible at /theme/<theme_folder>/cat.jpg.
Theme name included for potential multi-theme compatibility.

Considerations

  • Only "web safe" content-types are provided (to limit access surface area of serving html/php files).
  • A static 1 day cache time it set on served files (could be override at webserver level if needed).

Todo

  • Testing
  • Update dev docs for theme systems

Doc Updates

  • Note potential breaking change/exposure if a public/ theme folder already exists.

Allows files to be placed within a "public" folder within a theme
directory which the contents of will served by BookStack for access.

- Only "web safe" content-types are provided.
- A static 1 day cache time it set on served files.

For #3904
Existing mime sniffer wasn't great at distinguishing between plaintext
file types, so added a custom extension based mapping for common web
formats that may be expected to be used with this.
@ssddanbrown ssddanbrown merged commit 786a434 into development Jan 14, 2025
@ssddanbrown ssddanbrown deleted the public_theme_files branch January 14, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant